﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WeChatParking.Core.BLL
{
    public class ParkingInfo
    {
        public int Add(Entity.ParkingInfo model)
        {
            using (var dbContext = Repository.DbContext.Create())
            {

                int roelID = dbContext.Insert<Entity.ParkingInfo>(model);
                return roelID;
            }

        }
        public Entity.ParkingInfo Get(int parkId)
        {
            using (var dbContext = Repository.DbContext.Create())
            {
                var precidate = new { parkId = parkId };
                return dbContext.GetList<Entity.ParkingInfo>(precidate, null).FirstOrDefault();
            }
        }
        public bool Update(Entity.ParkingInfo model)
        {
            using (var dbContext = Repository.DbContext.Create())
            {
                return dbContext.Update<Entity.ParkingInfo>(model);
            }
        }
    }
}
